The invention relates generally to decoders for bar code scanners, and in particular to a decoder capable of processing the output data from either wand scanners or from moving beam laser scanners.
Bar codes are printed patterns that represent information and are machine readable. Bar codes consist of alternating bars and spaces whose varying widths encode sets of characters, such as letters and digits. Because bar codes have proven faster and more accurate than keyboard entry, manufacturers of data collection terminals, point- of-sale terminals, keyboards, weighing scales, and other data collection and material handling equipment are finding a growing demand for bar code reading capability in their products. Bar code labelling is used for product identification and tracking in industries such as medical labs, food processing and sales, and automobile manufacturing.
In a bar code label, each individual character is represented by an ordered group of individual bars and spaces. The bars and spaces, referred to as elements, come in a range of discrete widths, and the width of each element must be a multiple of a standard dimension called a module. In most bar codes, elements are from one to three modules wide. A module has a specified set of absolute widths and tolerances for each bar code symbology. The character set representable by the bar code and the number of elements per character vary from one symbology to another. For example, the character "0" in the Universal Product Code symbology can be represented by the sequence: bar 3 modules wide, space 2 modules wide, bar 1 module wide, space 1 module wide.
Bar codes are read in a two step process: scanning and decoding. The scanning step serves to create an electrical signal that represents the widths of the bars and spaces of the bar code being scanned. In the decoding step, the signal provided by the scanner is measured and interpreted to form the characters encoded in the bar code.
Scanning devices fall into two major categories: those that require the operator to provide scanning motion, and those that do not. The most common type from the first category is the hand held bar code scanning wand, and the most common from the second category is the hand held moving beam laser scanner. Both types of scanning devices use a light source directed from within the scanner to illuminate an area on the target bar code tag. A photodetector is imaged onto the illuminated area, and senses light along the path of the scanning motion, which may be manual in the case of a wand or by means of automatically moving parts in the case of a moving beam scanner. As the photodetector reacts to the presence or absence of reflected light from the bars and spaces, the scanner produces an analog or digital output signal which is at one level when sensing a bar and at another level when sensing a space. While scanning a bar code, the relative durations of the alternating output states are measured as time intervals by the decoder, and correspond to the relative widths of the printed elements.
The absolute values of the time intervals are related inversely to the velocity of the scanning motion. The faster the scanning motion, the smaller the time intervals. Also, the less variation in velocity (acceleration), the less variation in the average size of the time intervals. Thus, when comparing the time intervals from a wand, which is moved by hand, to a laser scanner, which employs rotating mirrors to rapidly move the laser beam, two main differences are apparent:
(1) the range of useful values of the time intervals for the wand is approximately 300 microseconds to 100 milliseconds, whereas for the laser scanner, the range is approximately 10 microseconds to 400 microseconds; and PA0 (2) the acceleration experienced by the scanner and the corresponding change in the time interval values is much greater for the wand than for the laser.
The decoder consists of both hardware and software for processing the scanner signal and producing decoded data. FIG. 1 shows schematically a typical decoder configuration. Decoder 11 includes one or more timers 12 to measure the time intervals of pulses from the scanner output, a microprocessor 18, read-only memory 20 which contains decoding software, random-access memory 22 for variable arrays and buffers, and I/0 circuitry 24. The software performs time interval data acquisition and storage, transformation from time interval values to decoded characters, as well as various I/0 functions depending on the application.
In the past, decoders for hand held laser scanners and hand held wand scanners have been separate devices, or at least have used separate hardware components for reading bar codes with the two scanner types. The decoding software has been specific to the type of scanner being used. It would be advantageous to have a single decoder--one set of hardware components and one decoding program--that can function with either a wand or a laser scanner. The designer of a system which uses bar codes need not duplicate his efforts to incorporate both wand and laser scanning, if the decoder allows the facile interchange of scanners.
One system is currently in use which can take input from either scanner type, but requires replication of some hardware and software, and still does not operate as efficiently as a single decoder. This system, as illustrated in FIG. 2, consists of a wand decoder 26 and an adaptor 28 for the laser scanner. The adaptor 28 includes the timers, microprocessor, ROM, and RAM needed to decode the laser output signals. The adaptor itself decodes the laser output and then creates a simulated wand output signal as though a wand had been used for scanning. The new signal is fed to the wand decoder 26, which re-decodes it and performs the input/output functions of the application. The disadvantages of this approach are that most of the decoding hardware and software is duplicated, and decoding efficiency is reduced because two decodings must be performed sequentially for each bar code read.
In accordance with the present invention, a better solution for decoding the output of both wand and laser scanners can be implemented through efficient software installed in a single decoder to perform both wand and laser decoding functions without extra hardware. The combination of decoding functions is done by transforming the output data from the wand scanner so that it has the same characteristics as the output of the laser scanner. Once the transformation is accomplished, the decoding process and the hardware needed are the same for either type of scanner input, so one decoder system suffices.
In order to combine decoding software for both wand and laser scanners without increasing the amount of decoder hardware, it is necessary to minimize program memory space, data memory space, and decoding execution time. This is achieved in the embodiment of the invention, which is a method of scaling and compensating wand time intervals as they are acquired by the decoding hardware so that the resulting range of time interval values is equivalent to the range for a laser, and the apparent acceleration effects on the time interval data are greatly reduced or eliminated. Then wand data may be decoded with the routines that are used to decode laser data. Since wand data decoding routines are no longer necessary, program memory space is saved. Since the range of values of the time intervals is limited, fewer bits are needed to represent them, so data memory space is saved. Finally, execution time for decoding is saved because decoding routines that handle numbers represented by fewer bits run more quickly, and acceleration compensation routines need not be distributed among the decoding algorithms for separate bar code types. The savings in memory space and execution time are advantageous even in a wand decoder system that does not include the capability of handling laser scanner output, because more features and decoding functions can be added to the system without adding more hardware.
The scaling and compensation is performed as the wand time intevals are acquired, so that only scaled and compensated data is stored for decoding. An interrupt driven time interval acquisition routine stores wand data in its unscaled, uncompensated form in a circular queue, and another routine performs the scaling and compensation, emptying the queue continuously. The scaling and compensation consists of dividing each raw time interval by a dynamic scaling factor and keeping the quotient, which becomes the new time interval measurement used by the decoding routines. The scaling factor is the output of a digital filter whose input is the current quotient, a window of previous raw time intervals, and a window of previous scaled, compensated time intervals. The function of the digital filter is to update the scaling factor so that the next quotient will remain in the desired range; this also has the effect of removing the apparent acceleration.